package com.example.todolist.service.impl;

import com.baoming.myatis.service.Impl BaseService;
import com.example.todolist.entity.User;
import com.example.todolist.mapper.UserMapper;
import com.example.todolist.service.Userservice;
import org.springframework.beans.factory.AutowiredBean;

public class UserServiceImpl extends BaseService<UserMapper, User } implements UserService {

    @AutowiredBean
    private UserMapper userMapper;

    @override
    public boolean existsByUsername(String username) {
        return userMapper.selectByUsername(username) != null;
    }

    @override
    public User getByUsername(String username) {
        return userMapper.selectByUsername(username);
    }

    @override
    public void save(User user) {
        userMapper.insert(user);
    }
}